<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  <title>EPICS exampleJava/exampleLink</title>
  <link rel="stylesheet" type="text/css"
  href="http://epics-pvdata.sourceforge.net/base.css" />
  <link rel="stylesheet" type="text/css"
  href="http://epics-pvdata.sourceforge.net/epicsv4.css" />
  <style type="text/css">
/*<![CDATA[*/
     .about { margin-left: 3em; margin-right: 3em; font-size: .83em}
     table { margin-left: auto; margin-right: auto }
     .diagram { text-align: center; margin: 2.5em 0 }
     body { margin-right: 10% }
/*]]>*/</style>

 <!-- Script that generates the Table of Contents -->
  <script type="text/javascript" src="http://epics-pvdata.sourceforge.net/script/tocgen.js"></script>

</head>

<body>

<div class="head">
<h1>EPICS exampleJava/exampleLink</h1>
<h2 class="nocount">2017.12.19</h2>

<h2 class="nocount">Abstract</h2>
<p>
<b>exampleLink</b> implements PVRecords that link to another record..
The following records are imlemented:
</p>
<dl>
   <dt>ExampleGetLinkRecord</dt>
     <dd>
      A record that creates a PvaClentGet to a channel.
      When the record is processed it executes a channelGet.
     </dd>
   <dt>ExampleMonitorLinkRecord</dt>
     <dd>A record that creates a monitor to a channel..
       When a monitor event or connection state change occurs it processes the record.</dd>
   <dt>ExamplePutLinkRecord</dt>
      <dd>A record that, when processed, executes a channelPut.</dd>
</dl>

  
</div> <!-- head -->

<div id="toc">
  <h2 class="nocount">Table of Contents</h2>
</div>

<!-- Place what you would like in the Table of Contents, inside the contents div -->
<div id="contents" class="contents">	  
<hr />

<h2>Overview</h2>
<p><b>exampleLink</b> implements PVRecords that use pvAccess to access a DBRecord
that can reside in the same IOC or in another IOC.
</p>
<p>
The example creates records named <b>exampleMonitorLink</b>, <b>exampleGetLink</b>, and <b>examplePutLink</b>.
Each record uses <b>PvaChannelMonitor</b>, <b>PvaChannelGet</b>, or <b>PvaChannelPut</b>
to connect to the channel.
</p>
<p>
Note that each example, instead of using pvAccess itself, makes pvaClient calls.
Each implements a class that uses the non blocking features of pvaClientJava.
Each class could be used as a starting point for other PVRecord support that wants to use pvAccess.
</p>
<p>Each example handles change of connection state.
The alarm field of the record shows the connection state.
</p>
<h2>exampleLinkMain</h2>
<p>exampleLinkMain supports help as follows:</p>
<pre>
mrk> pwd
/home/epicsv4/release4_6/exampleJava/exampleLink
mrk> scripts/exampleLinkMain -help
provider linkedRecordName valueisArray generateLinkedRecord
default
pva doubleArray true true
mrk> 
</pre>
The arguments are:
<dl>
   <dt>provider</dt>
     <dd>
      This can be <b>pva</b> or <b>ca</b>.
      <br />
      <b>ca</b> only works if channelName is a accessable via the ca network protocol,
      e. g. it is the name of a DBRecord in a V3 IOC.
     </dd>
   <dt>linkedRecordName</dt>
     <dd>
       The name of the channel to which records
       exampleMonitorLink, exampleGetLink, and examplePutLink connect.
     </dd>
   <dt>valueisArray</dt>
     <dd>
      If <b>true</b> then the value fields of records
      <b>exampleMonitorLink</b>, <b>exampleGetLink</b>, and <b>examplePutLink</b>
      will be a scalar array of type double.
      <br />
      If <b>true</b> then the value fields of records
      <b>exampleMonitorLink</b>, <b>exampleGetLink</b>, and <b>examplePutLink</b>
      will be a scalar double.
     </dd>
   <dt>generateLinkedRecord</dt>
     <dd>
      If true then record generateLinkedRecord is allocated in the same IOC.
     </dd>
</dl>
<h2>exampleLinkClient</h2>
<p>exampleLinkClient supports help as follows:</p>
<pre>
mrk> pwd
/home/epicsv4/release4_6/exampleJava/exampleLink
mrk> scripts/exampleLinkClient -help
provider linkedRecordName
default
pva doubleArray
</pre>
The arguments are:
<dl>
   <dt>provider</dt>
     <dd>
      This can be <b>pva</b> or <b>ca</b>.
      <br />
      <b>ca</b> only works if channelName is a accessable via the ca network protocol,
      e. g. it is the name of a DBRecord in a V3 IOC.
     </dd>
   <dt>linkedRecordName</dt>
     <dd>
       The name of the channel to which records
       exampleMonitorLink, exampleGetLink, and examplePutLink connect.
     </dd>
</dl>
<h2>doubleArrayMain</h2>
<p>doubleArrayMain supports help as follows:</p>
<pre>
mrk> pwd
/home/epicsv4/release4_6/exampleJava/exampleLink
mrk> scripts/exampleLinkdoubleArrayMain -help
doubleArrayRecordName
default
doubleArrayExternal
</pre>
The argument is:
<dl>
   <dt>doubleArrayRecordName</dt>
     <dd>
     The channel name of the PVRecord.
     </dd>
   <dt>linkedRecordName</dt>
     <dd>
       The name of the channel to which records
       exampleMonitorLink, exampleGetLink, and examplePutLink connect.
     </dd>
</dl>
<h2>Using exampleLinkMain to test providers pva and ca</h2>
<h3>channel provider pva</h3>
<p>Just start exampleLinkMain and exampleLinkClient with the default options.</p>
<h3>channel provider local</h3>
<p>start exampleLinkMain with the default options.</p>
<pre>
scripts/exampleLinkMain
</pre>
<p>exampleLinkClient can be started with the default options.</p>
<h3>channel provider ca</h3>
<p>In order to test using provider <b>ca</b>
a softIoc for record doubleArray must also be started:</p>
<pre>
mrk> pwd
/home/epicsv4/master/exampleJava/exampleLink/v3IOC
mrk> softIoc st.cmd
</pre>
<p>Start exampleLinkMain:</p>
<pre>
scripts/exampleLinkMain ca doubleArray true false
</pre>
<p>Start exampleLinkClient:</p>
<pre>
scripts/exampleLinkClient ca
</pre>

</div> <!-- class="contents" -->
</body>
</html>
